import httpx

url = 'https://example.com/submit_form'
data = {
    'username': 'your_username',
    'password': 'your_password'
}

try:
    response = httpx.post(url, data=data)
    response.raise_for_status()  # 检查HTTP请求是否成功
    print(response.text)
except httpx.HTTPStatusError as e:
    print(f"HTTP error occurred: {e}")
except Exception as e:
    print(f"An error occurred: {e}")
